<!DOCTYPE html>
<html lang="en">
<head>
    {include file='public/header' /}
    <!-- Bootstrap Colorpicker CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/mjolnic-bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css" rel="stylesheet" type="text/css"/>
    <!-- select2 CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/select2/dist/css/select2.min.css" rel="stylesheet" type="text/css"/>

    <!-- switchery CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/switchery/dist/switchery.min.css" rel="stylesheet" type="text/css"/>

    <!-- bootstrap-select CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/bootstrap-select/dist/css/bootstrap-select.min.css" rel="stylesheet" type="text/css"/>

    <!-- bootstrap-tagsinput CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/>

    <!-- bootstrap-touchspin CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.css" rel="stylesheet" type="text/css"/>

    <!-- multi-select CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/multiselect/css/multi-select.css" rel="stylesheet" type="text/css"/>
    <!-- Bootstrap Switches CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" rel="stylesheet" type="text/css"/>
    <!-- Bootstrap Datetimepicker CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
    <!-- Custom CSS -->
    {include file='public/comn_css' /}
</head>
<body>
<!--Preloader-->
<div class="preloader-it">
    <div class="la-anim-1"></div>
</div>
<!--/Preloader-->
<div class="wrapper  theme-5-active pimary-color-blue">

    <!-- Top Menu Items -->
    {include file='public/top_menu' /}
    <!-- /Top Menu Items -->

    <!-- Left Sidebar Menu -->
    {include file='public/sidebar' /}
    <!-- /Left Sidebar Menu -->

    <!-- Main Content -->
    <div class="page-wrapper">
        <div class="container-fluid">
            <!-- Title -->
            <div class="row heading-bg">
                <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                    <h5 class="txt-dark">模版路由设置</h5>
                </div>
                <!-- Breadcrumb -->
                <div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
                    <ol class="breadcrumb">
                        <li><a href="{:url('admin/index/index')}">系统首页</a></li>
                        <li><a href="{:url('admin/template/index')}">规则列表</a></li>
                        <li class="active"><span>添加规则</span></li>
                    </ol>
                </div>
                <!-- /Breadcrumb -->
            </div>
            <!-- /Title -->

            <!-- Row -->
            <div class="row">
                <div class="col-lg-12 col-sm-12">
                    <div class="panel panel-default card-view">
                        <div class="panel-wrapper collapse in">
                            <div class="panel-body">
                                <form class="form-horizontal" id="system_form" method="post" action="{:url('doAdd')}" enctype="multipart/form-data">
                                    <div class="form-group">
                                        <label class="control-label mb-10 col-sm-2" for="moudle">模块:</label>
                                        <div class="col-sm-8">
                                            <select name="moudle" id="moudle" class="form-control" required>
                                                <option value="home">电脑</option>
                                                <option value="mobile">手机</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label mb-10 col-sm-2" for="controller">控制器名称:</label>
                                        <div class="col-sm-8">
                                            <input type="text" class="form-control" id="controller" name="controller" placeholder="请输入 控制器名称" value="Index" required>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label mb-10 col-sm-2" for="action">操作名称:</label>
                                        <div class="col-sm-8">
                                            <input type="text" class="form-control" id="action" name="action" placeholder="请输入 操作名称" value="index" required>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label mb-10 col-sm-2" for="tpl">模版选择:</label>
                                        <div class="col-sm-8">
                                            <!--<select class="select2 select2-multiple" multiple="multiple" data-placeholder="Choose" name="tpl[]" id="tpl" required>
                                                {notempty name='list'}
                                                {foreach name='list' item='value'}
                                                <option value="{$value}">{$value}</option>
                                                {/foreach}
                                                {/notempty}
                                            </select>-->
                                            <select multiple data-role="tagsinput" name="tpl[]" id="tpl" required></select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label mb-10 col-sm-2" for="remark">备注说明:</label>
                                        <div class="col-sm-8">
                                            <textarea name="remark" id="remark" cols="30" rows="5" class="form-control" placeholder="请输入 备注说明"></textarea>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label mb-10 col-sm-2">状态</label>
                                        <div class="col-sm-8">
                                            <div class="radio radio-info">
                                                <input type="radio" name="status" id="radio1" value="1" checked="">
                                                <label for="radio1">
                                                    启用
                                                </label>
                                            </div>
                                            <div class="radio radio-info">
                                                <input type="radio" name="status" id="radio2" value="0">
                                                <label for="radio2">
                                                    禁用
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <button type="submit" class="btn btn-success"><span class="btn-text">提交</span></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Row -->

        </div>
        <!-- Footer -->
        {include file='public/footer' /}
        <!-- /Footer -->

    </div>
    <!-- /Main Content -->

</div>
<!-- /#wrapper -->

<!-- JavaScript -->

<!-- jQuery -->
<script src="__PUBLIC__/admin/vendors/bower_components/jquery/dist/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- Moment JavaScript -->
<script type="text/javascript" src="__PUBLIC__/admin/vendors/bower_components/moment/min/moment-with-locales.min.js"></script>

<!-- Bootstrap Colorpicker JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>

<!-- Switchery JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/switchery/dist/switchery.min.js"></script>

<!-- Select2 JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/select2/dist/js/select2.full.min.js"></script>

<!-- Bootstrap Select JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>

<!-- Bootstrap Tagsinput JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>

<!-- Bootstrap Touchspin JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js"></script>

<!-- Multiselect JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/multiselect/js/jquery.multi-select.js"></script>


<!-- Bootstrap Switch JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>

<!-- Bootstrap Datetimepicker JavaScript -->
<script type="text/javascript" src="__PUBLIC__/admin/vendors/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>

<!-- Form Advance Init JavaScript -->
<script src="__PUBLIC__/admin/dist/js/form-advance-data.js"></script>

<!-- Slimscroll JavaScript -->
<script src="__PUBLIC__/admin/dist/js/jquery.slimscroll.js"></script>

<!-- Fancy Dropdown JS -->
<script src="__PUBLIC__/admin/dist/js/dropdown-bootstrap-extended.js"></script>

<!-- Owl JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>

<!-- Init JavaScript -->
{include file='public/comn_js' /}

<script src="__PUBLIC__/admin/dist/js/jquery.form.js"></script>
<script src="__PUBLIC__/admin/vendors/layer/layer.js"></script>
<script>
    $('#system_form').submit(function() {
        var index;
        // submit the form
        $(this).ajaxSubmit({
            beforeSubmit: function () {
                index = layer.load(1, {shade:[0.6, '#000']});
            },
            success: function (responseText, statusText) {
                if (responseText.status)
                {
                    layer.msg('添加成功！', {shade: [0.6, '#000'], time:3000}, function () {
                        window.location.href="{:url('index')}";
                    });
                } else {
                    layer.msg(responseText.msg, {shade: [0.6, '#000'], time:3000}, function () {
                        $('#system_form')[0].reset();
                    });
                }
            }
        });
        // return false to prevent normal browser submit and page navigation
        return false;
    });
</script>
</body>
</html>